<?php
if($_POST['search_submit']!=''){
    if($_POST['t']!=''&&$_POST['search']!=''){
        $uid = getIdByRealname($_POST['t']);
        if($uid == '')
        {
            fs_showmsg('没有找到该老师,请检查老师姓名是否正确!');
        }
        else
        {
            switch(intval($_POST['search']))
            {
                case 1:
                    echo "<script>location.href='?do=videolist&teacher_id=".$uid."';</script>";
                    //header('Location:http://www.baidu.com');
                    break;
                case 2:
                    echo "<script>location.href='?do=coursewarelist_t&teacher_id=".$uid."';</script>";
                    //header("LOCATION:?do=coursewarelist_t&teacher_id=$uid");
                    break;
                case 3:
                    echo "<script>location.href='?do=examlist&tid=".$uid."';</script>";
                    //header('Location:http://www.baidu.com');
                    //header("LOCATION:?do=examlist&tid=$uid");
                    break;
                default:
                    fs_showmsg('查询出现错误!');
            }
        }
    }
    else
    {
         fs_showmsg('老师姓名和搜索类型不能为空!');
    }
}
?>
